package io.lvdaxian.tuning.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
  
  @GetMapping("/get/{flag}")
  public void get(@PathVariable("flag") String flag) throws InterruptedException {
    while (true) {
      // 执行一些计算密集型操作，例如循环计算
      for (int i = 0; i < Integer.MAX_VALUE; i++) {
        if ("1".equals(flag)) {
          Thread.sleep(20);
        }
        double result = Math.pow(Math.random(), Math.random());
      }
    }
  }
}
